<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<?php
session_start();
include 'Include.php';
?>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
		
		<script type="text/javascript">

		  function checkForm(form)
		  {
			...

			if(!form.captcha.value.match(/^\d{5}$/)) {
			  alert('Please enter the CAPTCHA digits in the box provided');
			  form.captcha.focus();
			  return false;
			}

			...

			return true;
		  }

		</script>
		
		<style type="text/css">
		
			body{
				min-width:800px;
                width:auto!important;
                width:800px;
                height:5000px;
				background-image:url(../img/sharp_edge.png);
                background-repeat:repeat;
			}
			
			label{
				color:white;
			}
			
		</style>
    </head>

    <body>
        <?php include 'navBar.php'; ?>
        <div style="margin-top:50px;">

            <div class="container">
                <form action="../controleur/controleurFormulaire.php" method="POST" onsubmit="return checkForm(this);>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <label for="nom">Nom</label>
                            <input name ="nom" type="text" id="Nom" class="form-control" placeholder="Nom" maxlength="50" required  <!--oninvalid="this.setCustomValidity('User ID is a must')"--> value=<?php if (isset($_GET['nom'])) echo $_GET['nom']; ?>>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <?php
                            if (isset($_GET['messageEnom'])) {
                                echo ("<br/><p style=\"color:red;\">" . $_GET['messageEnom'] . "</p>");
                            }
                            ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <label for="prenom">Prénom</label>
                            <input name ="prenom" type="text" id="Prenom" class="form-control" placeholder="Prenom" required value=<?php if (isset($_GET['prenom'])) echo $_GET['prenom']; ?>>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <?php
                            if (isset($_GET['messageEprenom'])) {
                                echo ("<br/><p style=\"color:red;\">" . $_GET['messageEprenom'] . "</p>");
                            }
                            ?>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <label for="datepicker">Date de Naissance</label>            
                            <input  name ="dateNaissance" type="text" class="form-control" id="datepicker" placeholder="Date de naissance" required value=<?php if (isset($_GET['dateDeNaissance'])) echo $_GET['dateDeNaissance']; ?>>                    
                            <script>
                                $(function() {
                                    $("#datepicker").datepicker({dateFormat: "dd/mm/yy"});
                                });</script>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <label for="email">Adresse Email</label>
                            <input name ="email" type="email" class="form-control" id="email" placeholder="Email" required <?php if (isset($_GET['email'])) echo $_GET['email']; ?>>
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <?php
                            if (isset($_GET['messageEemail'])) {
                                echo ("<br/><p style=\"color:red;\">" . $_GET['messageEemail'] . "</p>");
                            }
                            ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <label for="password">Mot de passe</label>
                            <input name ="password" type="password" class="form-control" id="password" placeholder="Mot de passe" required >
                        </div>
                        <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
                            <?php
                            if (isset($_GET['messageEpassword'])) {
                                echo ("<br/><p style=\"color:red;\">" . $_GET['messageEpassword'] . "</p>");
                            }
                            ?>
                        </div>
                    </div>
                    <br/>
					
					<p><img src="captcha.php" width="120" height="30" border="1" alt="CAPTCHA"></p>
					<p><input type="text" size="6" maxlength="5" name="captcha" value=""><br></p>
					<?php
						if(isset($_GET['error'])){
							echo "<span style=\"color:red;\">captcha incorrect.</span>";
						}
					?>
					
                    <p><button type="submit" class="btn btn-default">S'inscrire</button></p>
                </form>
            </div>
        </div>




    </body>
</html>
